<!-- templates/base.html -->
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{% block title %}MyBlog{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
    <nav class="navbar navbar-expand-lg navbar-dark bg-primary mb-4">
        <div class="container">
            <a class="navbar-brand" href="{% url 'post-list' %}">MyBlog</a>
            <div class="navbar-nav ms-auto">
                {% if user.is_authenticated %}
                <a class="nav-link" href="{% url 'post-create' %}">New Post</a>
                <a class="nav-link" href="{% url 'account_logout' %}">Logout</a>
                {% else %}
                <a class="nav-link" href="{% url 'account_login' %}">Login</a>
                <a class="nav-link" href="{% url 'account_signup' %}">Register</a>
                {% endif %}
            </div>
        </div>
    </nav>

    <div class="container">
        <div class="row">
            <!-- 主内容区 -->
            <div class="col-md-8">
                {% block content %}
                {% endblock %}
            </div>

            <!-- 侧边栏 -->
            <div class="col-md-4">
                <div class="card mb-4">
                    <div class="card-header">
                        About
                    </div>
                    <div class="card-body">
                        <p class="card-text">欢迎来到我的博客！这里分享技术心得和生活感悟。</p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <footer class="bg-light text-center py-4 mt-4">
        <div class="container">
            <p>© 2023 MyBlog. All rights reserved.</p>
        </div>
    </footer>
</body>
</html>